﻿using System;

namespace NetMicro.EventBus.MySql
{
    public class EventBusMySqlOptions
    {

        public EventBusMySqlOptions()
        {
            RetryTableName = EventBusConsts.RetryTableName;
            DelayTableName = EventBusConsts.DelayTableName;
            DeadLetterTableName = EventBusConsts.DeadLetterTableName;
            RetryMessageExpireTime = TimeSpan.FromDays(15);
            DeadLetterMessageExpireTime = TimeSpan.FromDays(15);
            DelayMessageExpireTime = TimeSpan.FromDays(15);
            MessageLockExpireTime = TimeSpan.FromHours(1);
        }

        /// <summary>
        /// 重试消息表
        /// </summary>
        public string RetryTableName { get; set; }

        /// <summary>
        /// 延迟队列消息表
        /// </summary>
        public string DelayTableName { get; set; }

        /// <summary>
        /// 死信表名
        /// </summary>
        public string DeadLetterTableName { get; set; }

        /// <summary>
        /// 重试消息到期时间
        /// </summary>
        public TimeSpan RetryMessageExpireTime { get; set; }

        /// <summary>
        /// 死信消息到期时间
        /// </summary>
        public TimeSpan DeadLetterMessageExpireTime { get; set; }

        /// <summary>
        /// 延迟消息到期时间
        /// </summary>
        public TimeSpan DelayMessageExpireTime { get; set; }

        /// <summary>
        /// 消息锁到期时间
        /// </summary>
        public TimeSpan MessageLockExpireTime { get; set; }

        /// <summary>
        /// mysql数据库连接字符串
        /// </summary>
        public string ConnectionString { get; set; }


    }
}
